package com.wyd.component.consumer;

import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 雷哥
 * @Date: 2020/10/07/23:32
 * @Description:
 */
@Component
public class RoutingDirectConsumer {

//  @RabbitListener(bindings =@QueueBinding(   //把队列和交换机进行绑定
//        value = @Queue("queue1"),  //绑定队列
//        key = {"info","warm"},
//        exchange = @Exchange(name = "directs",type = ExchangeTypes.DIRECT )//绑定交换机和设置交换机的名称和类型
//    )
//  )
  public void receive1(String message){
    System.out.println("消费者【1】接收到消息:"+message);
  }

//  @RabbitListener(bindings =@QueueBinding(
//        value = @Queue("queue2"),
//        key = {"debug","error"},
//        exchange = @Exchange(name = "directs",type = ExchangeTypes.DIRECT )
//    )
//  )
  public void receive2(String message){
    System.err.println("消费者【2】接收到消息:"+message);
  }

}
